#ifndef ASTEROIDS_H
#define ASTEROIDS_H

#include <iostream>
#include <list>

#include "uiDraw.h"
#include "uiInteract.h"
#include "gameObjects.h"

#define MAX_BULLETS   50
#define MAX_BIG_ROCKS  5

using namespace std;

/*****************************************
 * ASTEROIDS : Asteroids class
 *****************************************/
class Asteroids
{
protected:
   Ship   m_ship;
   Ship   m_extraLives[MAX_LIVES];
   Bullet m_bullets[MAX_BULLETS];
   Score  m_score;
   list   <Rock *> m_rocks;

   void fire();
   void killBulet();
   void gameOver();

   float getMaxValue(list <Rock *>::iterator &iRock, int &iBullet);
   float minDist    (list <Rock *>::iterator &iRock, int &iBullet);

   float getMaxValueShip(list <Rock *>::iterator &iRock);
   float minDistShip    (list <Rock *>::iterator &iRock);

public:
   Asteroids();
   void operator ++ (int postfix);
   void draw();
   void interact(const Interface *pUI);

   void objectHit();
};

#endif // ASTEROIDS_H
